using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace UM_Model.Models.Mapping
{
    public class ActivityMap : EntityTypeConfiguration<Activity>
    {
        public ActivityMap()
        {
            // Primary Key
            this.HasKey(t => t.ActivityID);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(50);

            this.Property(t => t.Image)
                .HasMaxLength(200);

            // Table & Column Mappings
            this.ToTable("Activities");
            this.Property(t => t.ActivityID).HasColumnName("ActivityID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Quantity).HasColumnName("Quantity");
            this.Property(t => t.Image).HasColumnName("Image");
            this.Property(t => t.IsEnable).HasColumnName("IsEnable");
        }
    }
}
